<template>
  <div class="scroll-wrapper" ref="wrapper">
    <div class="scroll-content">
      <div v-if="data.status === 0">
        <no-data-tip
          v-show="
            (!data.viewDatas || data.viewDatas <= 0) &&
            (!data.foodDatas || data.foodDatas <= 0) &&
            (!data.hotelDatas || data.hotelDatas <= 0) &&
            (!data.massageDatas || data.massageDatas <= 0) &&
            (!data.ktvdatas || data.ktvdatas <= 0)
          "
        ></no-data-tip>
        <div v-if="data.viewDatas && data.viewDatas.length > 0">
          <home-title title="景点结果:"></home-title>
          <view-list :viewDatas="data.viewDatas"></view-list>
        </div>
        <div v-if="data.foodDatas && data.foodDatas.length > 0">
          <home-title title="美食结果:"></home-title>
          <food-list :foodDatas="data.foodDatas"></food-list>
        </div>
        <div v-if="data.hotelDatas && data.hotelDatas.length > 0">
          <home-title title="酒店结果:"></home-title>
          <hotel-list :hotelDatas="data.hotelDatas"></hotel-list>
        </div>
        <div v-if="data.massageDatas && data.massageDatas.length > 0">
          <home-title title="按摩结果:"></home-title>
          <massage-list :massageDatas="data.massageDatas"></massage-list>
        </div>
        <div v-if="data.ktvdatas && data.ktvdatas.length > 0">
          <home-title title="KTV结果:"></home-title>
          <ktv-list :ktvdatas="data.ktvdatas"></ktv-list>
        </div>
      </div>
      <error v-if="data.status === -1"></error>
    </div>
  </div>
</template>

<script>
import BetterScroll from "better-scroll";
import HomeTitleVue from "./Sub/HomeTitle";
import NoDataTip from "./Sub/NoDataTip";
import Error from "./Sub/Error";
import ViewList from "./ViewList";
import Foodist from "./Foodist";
import Hotelist from "./Hotelist";
import Massagelist from "./Massagelist";
import Ktvlist from "./KtvList";
export default {
  name: "SearchScrollWrapper",
  components: {
    HomeTitleVue,
    NoDataTip,
    ViewList,
    Error,
    Foodist,
    Hotelist,
    Massagelist,
    Ktvlist,
  },
  props: {
    data: Object,
  },
  data() {
    return {
      homeTitle: {
        viewTitle: "推荐景点",
      },
    };
  },
  mounted() {
    let scroll = new BetterScroll(this.$refs.wrapper);
  },
};
</script>

<style lang="scss" scoped></style>
